<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('员工工资列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 80px">工资发放月：</label>
                                <input type="text" name="salaryMonth"/>
                            </li>
                            <li>
                                <label>员工姓名：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <label>员工编号：</label>
                                <input type="text" name="userId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:salary:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:salary:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:salary:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.operate.exportSelectedSalary()" shiro:hasPermission="system:salary:export">
                    <i class="fa fa-download"></i> 导出
                </a>
                <!--<a class="btn btn-warning" onclick="test()">-->
                    <!--<i class="fa fa-download"></i> 测试-->
                <!--</a>-->
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:salary:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:salary:remove')}]];
        var prefix = ctx + "system/salary";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "员工工资",
                fixedColumns: true,
                fixedNumber: 3,
                fixedRightNumber: 3,
                columns: [
                    [
                        {
                            title : '',
                            align : 'center',
                            colspan : 1
                        },
                        {
                        title : '基本信息',
                        align : 'center',
                        colspan : 4
                        },
                        {
                            title : '合计',
                            align : 'center',
                            colspan : 2
                        },
                        {
                            title : '应发项目',
                            align : 'center',
                            colspan : 12
                        },
                        {
                            title : '扣除项目',
                            align : 'center',
                            colspan : 8
                        },
                        {
                            title : '其他',
                            align : 'center',
                            colspan : 3
                        }
                    ],
                    [
                        {
                            checkbox: true,
                            singleSelect: true
                        },
                        {
                            field: 'id',
                            title: '应发工资编号',
                            visible: false
                        },
                        {
                            field: 'userId',
                            title: '员工编号'
                        },
                        {
                            field: 'userName',
                            title: '员工姓名'
                        },
                        {
                            field: 'salaryMonth',
                            title: '工资发放月'
                        },
                        {
                            field: 'needPayTotal',
                            title: '应发合计金额'
                        },
                        {
                            field: 'acctralPayTotal',
                            title: '实发合计金额'
                        },
                        {
                            field: 'dutyWorkDay',
                            title: '理应在职天数'
                        },
                        {
                            field: 'actualWorkDay',
                            title: '实际在职天数'
                        },
                        {
                            field: 'baseSalary',
                            title: '基本工资'
                        },
                        {
                            field: 'livingAllowance',
                            title: '生活补贴'
                        },
                        {
                            field: 'mealAllowance',
                            title: '餐费补贴'
                        },
                        {
                            field: 'transportationAllowance',
                            title: '交通补贴'
                        },
                        {
                            field: 'communicationAllowance',
                            title: '通讯补贴'
                        },
                        {
                            field: 'managementPositionAllowance',
                            title: '管理岗位津贴'
                        },
                        {
                            field: 'technologyPositionAllowance',
                            title: '技术岗位津贴'
                        },
                        {
                            field: 'expatriateAllowance',
                            title: '外派津贴'
                        },
                        {
                            field: 'overtimeHours',
                            title: '加班小时数'
                        },
                        {
                            field: 'overtimePay',
                            title: '加班费'
                        },
                        {
                            field: 'lateDeductionMinutes',
                            title: '迟到分钟数'
                        },
                        {
                            field: 'lateDeduction',
                            title: '迟到扣除金额'
                        },
                        {
                            field: 'personalLeaveDays',
                            title: '事假天数'
                        },
                        {
                            field: 'personalLeaveDeduction',
                            title: '事假扣款金额'
                        },
                        {
                            field: 'sickLeaveDays',
                            title: '病假天数'
                        },
                        {
                            field: 'sickLeaveDeduction',
                            title: '病假扣款金额'
                        },
                        {
                            field: 'personalTaxDeduction',
                            title: '个税扣除'
                        },
                        {
                            field: 'fiveInsurancesAndOneFund',
                            title: '五险一金扣除金额'
                        },
                        {
                            field: 'bankAccount',
                            title: '银行账号'
                        },
                        {
                            field: 'tenantId',
                            title: '租户编号',
                            visible: false
                        },
                        {
                            title: '操作',
                            align: 'center',
                            formatter: function(value, row, index) {
                                var actions = [];
                                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + Number(row.id) + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                                return actions.join('');
                            }
                        }
                    ]
                ]
            };
            $.table.init(options);
        });

        // function test(){
        //     var ids = $.table.selectColumns("id");
        //     // var data = { "ids": rows.join() };
        //     console.log(ids);
        // }
    </script>
</body>
</html>